﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using NETCORE.Autofac.Service;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace NETCORE.Autofac.Controllers
{
    [Route("api/[controller]")]
    public class PayController : Controller
    {
        private IPayService _payService;

        public PayController(IPayService payService)
        {
            _payService = payService;
        }


        [Route("GetPayType")]
        [HttpGet]
        public JsonResult GetPayType()
        {
            string paytype = this._payService.Pay();

            return new JsonResult(new { paytype = paytype });
        }

    }
}
